package org.example.agent;

import net.bytebuddy.implementation.bind.annotation.AllArguments;
import net.bytebuddy.implementation.bind.annotation.Origin;
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
import net.bytebuddy.implementation.bind.annotation.SuperCall;

import java.lang.reflect.Method;
import java.util.concurrent.Callable;

public class RequestTimeInterceptor {

    @RuntimeType
    public static  Object interceptor(@Origin Method method, @AllArguments Object[] args, @SuperCall Callable<?> callable) throws Exception{
        System.out.println("方法执行前");
        callable.call();
        System.out.println("方法执行后");
        return null;
    }
}
